/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Cards;

import java.util.ArrayList;

/**
 *
 * Class Deck. 
 * @author masterinftel11
 * @param <T>
 */
public class Deck <T> extends ArrayList<T>{
    private static final long serialVersionUID = 7526472295622776147L;
    /**
     * Initialize Deck
     */
    public Deck(){
        super();
    }
    
    /**
     * Method to take card
     * @return Card
     */
    public T takeCard(){
        T cardToReturn = get(0);
        remove(cardToReturn);
        return cardToReturn;
    }
    
    @Override
    public String toString() {
        StringBuilder str = new StringBuilder();
        for (T card : this){
            str.append(card.toString()).append("\n");
        }
        return str.toString();
    }
}
